package cn.zyq.ykb.controller.h5.config;

import cn.zyq.ykb.beans.config.ConfigProp;
import cn.zyq.ykb.system.common.BaseController;
import cn.zyq.ykb.service.config.ConfigPropService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import cn.zyq.ykb.system.common.PageParam;

/**
 * 置顶道具配置Controller
 *
 * @author SystemAuth
 * @date 2023-05-24
 */

@RestController(value = "H5ConfigPropController")
@RequestMapping("/api/configProp")
@Api(tags = "置顶道具配置接口")
public class ConfigPropController extends BaseController {

    @Autowired
    private ConfigPropService configPropService;

    /**
     * 查询置顶道具配置列表
     */
    @ApiOperation(value = "列表", response = ConfigProp.class)
    @PostMapping("/list")
    public Object list(@RequestBody PageParam pageParam) {
        return this.configPropService.selectConfigPropList(pageParam);
    }

    /**
     * 刷新置顶下单购买
     */
    @ApiOperation(value = "刷新置顶下单购买", response = ConfigProp.class)
    @PostMapping("/propOrder")
    public Object propOrder(@RequestBody ConfigProp pageParam) {
        return this.configPropService.propOrder(pageParam,this.request, this.getLoginUser());
    }

    /**
     * 道具刷新
     */
    @ApiOperation(value = "道具刷新", response = ConfigProp.class)
    @GetMapping("/sxProp/{taskID}")
    public Object sxProp(@PathVariable("taskID") Integer taskID) {
        return this.configPropService.sxProp(taskID,this.getLoginUser());
    }

    /**
     * 道具置顶
     */
    @ApiOperation(value = "道具置顶", response = ConfigProp.class)
    @GetMapping("/zdProp/{taskID}")
    public Object zdProp(@PathVariable("taskID") Integer taskID) {
        return this.configPropService.zdProp(taskID,this.getLoginUser());
    }
}
